package user;

import book.BookList;
import function.*;

public class NormalUser extends User{
    @Override
    public void menu() {
        System.out.println("*****普通用户*****");
        System.out.println("0. 退出");
        System.out.println("1. 展示图书");
        System.out.println("2. 搜索图书");
        System.out.println("3. 借书");
        System.out.println("4. 还书");
        System.out.println("*****************");
    }

    public NormalUser(String name) {
        super(name);
        functions = new Function[]{
                new Exit(),
                new Show(),
                new Search(),
                new Borrow(),
                new Return()
        };
    }

    @Override
    public void choice(int num, BookList bookList) {
        functions[num].work(bookList);
    }
}
